In Java:
The access permissions in Java include public, private, protected, and default package access permissions. If the attribute methods in the class do not show the specified access permission, the package access permission is granted, I like
From: http://tutorials.jenkov.com/java-reflection/private-fields-and-methods.htmlAlthough we generally think that it is possible to access private fields and private methods of other classes through the reflection mechanism of Java, it is not so
Analyze the public, protected, private, and default access permissions of java from the perspective of instances, publicprotected
1. public
Same package
1. Internal
Public class A {public int f = 1; public void m1 () {} public void m2 () {f = 2;
Java Tour (ix)--object class, Equals,tostring,getclass, inner class access rule, static inner class, Inner class principle, anonymous inner class
Every day by some trivial harassment, learning to continue
I. Object class
What
In Java programming, a member is decorated with the private keyword, and only the class in which the member is located and the method of the class are available, and no other class can access the private member.
The basic function of the private
The following is a comprehensive revision of the original Java face test set and answers to the questions and answers, the original topic has a lot of repeated topics and worthless topics, there are a lot of reference to the answer is also wrong,
Java Basics-Stack and heap, static, final modifier, inner class, and Java memory allocation (RPM)Java Stack and heapHeap: Random in orderStack: LIFO (last-in/first-out).The Java heap is a run-time data area in which the objects of the class allocate
In Java programming, a member is decorated with the private keyword, and only the class in which the member is located and the method of the class are available, and no other class can access the private member.
The basic function of the private
Java study notes 9-internal class summary, study notes 9 --
Java learning notes series:
Java study note 8-interface Summary
Java study notes 7 -- abstract classes and abstract methods
Java study Note 6-class inheritance, Object class
Java study
(5) package-related
Class: Use the class keyword to create a new class.For example:Class aclassname{Class body goes here}The words modifying class include public, abstract, and final. abstract and final cannot simultaneously modify class. Internal
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.